<?php
/**
 * Copyright (c) 2008 Rob Levin. All rights reserved.
 *
 * This software is provided "as is," without warranty of any kind, express or implied. In no event 
 * shall the author or contributors be held liable for any damages arising in any way from the use 
 * of this software. 
 * 
 * This work is licensed under the Creative Commons Atrribution License. To view a copy of this license,
 * visit http://creativecommons.org/licenses/by/3.0/us/; or, (b) send a letter to Creative Commons, 
 * 171 2nd Street, Suite 300, San Francisco, California, 94105, USA.
 */
  
 * Description:
 * Logging information constants.
 */

 class LogConstants {
 	
 	//  Logging Properties
 	public static $CUSTOM_LOG_FILE 	= "/usr/local/path/to/your/logs/php_logs.log";
 	public static $EMERG_EMAIL_TO	= "your_email@you.com";
 	public static $EMERG_EMAIL_FROM	= "server_email@you.com";

	// Log Types
	public static $SYSTEM_LOG 		= 0;
	public static $MAIL_LOG			= 1;
	public static $REMOTE_LOG 		= 2;
	public static $FILE_LOG 		= 3;
	
	// For development:
	public static $CURRENT_LOG_LEVEL = 6;	// FINEST
	
	// For production:
	//public static $CURRENT_LOG_LEVEL = 2;	// WARNING (SEVERE will also get logged)
	// or,
	//public static $CURRENT_LOG_LEVEL = 1;	// SEVERE only
	
	// Levels that can be set on a per message basis and then compared against
	// the above $CURRENT_LOG_LEVEL setting within the AerioSimplePHPLogging
	// functions. So basically:
	//			if(LogConstants::$CURRENT_LOG_LEVEL >= $log_level)
	// If log level set by the caller is less or equal then the log level we log.  
	// Otherwise we don't log the message (in fact we just don't do anything at all.)
	public static $SEVERE  = 1;
	public static $WARNING = 2;
	public static $INFO    = 3;
	public static $CONFIG  = 4;
	public static $FINE	   = 5;
	public static $FINEST  = 6;
	
	/**
	 * @return Returns the current log level setting as an int.
	 */
	public static function getCurrentLevel() {
		return self::$CURRENT_LOG_LEVEL;
	}
	
	/**
	 * @return Returns the log level as a String (as opposed to int)
	 */
	public static function levelToString($level) {
		if($level==self::$SEVERE)
			return 'SEVERE';
		else if($level==self::$WARNING)
			return 'WARNING';
		else if($level==self::$INFO)
			return 'INFO';
		else if($level==self::$CONFIG)
			return 'CONFIG';
		else if($level==self::$FINE)
			return 'FINE';
		else if($level==self::$FINEST)
			return 'FINEST';
		else 
			return 'UNKNOWN';	
	}
 }
?>
